Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

481
Visualizações
Changing Category/Channels Permissions Returns Error "Missing Permissions" - Novus/Discord.py

SOLVED - The categories/channels were set to private which is why they couldn't be changed even with the correct permissions. My solution was to tell the user which ones and to add the role with the permissions manually. I added a message that said they can just give the bot administrator permissions and it will do it for them. Hopefully, this helps anyone who runs into this in the future.

I'm trying to change the permissions of multiple categories and channels using the following code:

role = get(guild.roles, name="Fun")
for channel in guild.channels:
    overwrites = channel.overwrites_for(role)
    overwrites.view_channel = False
    await channel.set_permissions(role, overwrite=overwrites)

I get the following error:

await channel.set_permissions(role, overwrite=overwrites)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

It will work if I give the bot the administrator permission. However, it won't work if I give the bot every single other permission, the bot is at the top of the roles, and it has every category permission. What am I missing? I'm using Novus (fork of discord.py so it's pretty much the same thing).

Edit: I've asked people in the discord.py, Novus, and discord developers discord servers and they can't help me either. With the exception of the discord developers server they just didn't answer my question.

Edit 2: I was able to get it working when I manually added the bot's role to the category and enabled view_channel. This won't work, however, because that means the server owner has to manually do this for every category and channel which is really inconvenient.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This is simply how Discord works, if a channel is private and the bot does not have administrator permissions or role that has permissions to view the channel, it is not able to view it.

You can create a new category that the bot can access like this:

role = await guild.create_role(name="Fun")
category = await guild.create_category("category_name")
await category.set_permissions(role, read_messages=True, send_messages=True, connect=True, speak=True)
await category.set_permissions(ctx.guild.me, read_messages=True, send_messages=True, speak=True)

(How to give own bot permission to see categories?)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda